package com.yans
{
	import com.yans.interfaces.ICacheManager;
	import com.yans.interfaces.IFileManager;
	import com.yans.interfaces.IImageApi;
	import com.yans.interfaces.IKeyboardApi;
	import com.yans.interfaces.ILoaderManager;
	import com.yans.interfaces.ILogManager;
	import com.yans.interfaces.IMouseManager;
	import com.yans.interfaces.IRegexMatcher;
	import com.yans.interfaces.IRiverManager;
	import com.yans.interfaces.ISQLLiteManager;
	import com.yans.interfaces.ITimeManager;
	import com.yans.managers.CacheManager;
	import com.yans.managers.FileManager;
	import com.yans.managers.ImageApi;
	import com.yans.managers.KeyboardManager;
	import com.yans.managers.LoaderManager;
	import com.yans.managers.LogManager;
	import com.yans.managers.MouseManager; 
	import com.yans.managers.SQLLiteManager;
	import com.yans.managers.SQLManager;
	import com.yans.managers.TimeManager;
	
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.IEventDispatcher;
	
	public class GlobalAPI extends GlobalAPICore
	{
		/**
		 *	河流
		 */		
		public static var river:IRiverManager;
		/**
		 *	文件管理者 
		 */		
		public static var fileManager:IFileManager;
		/**
		 *	鼠标管理器 
		 */		
		public static var mouseManager:IMouseManager;
		/**
		 *	时间管理器 
		 */		
		public static var timeManager:ITimeManager;
		/**
		 *	缓存管理器 
		 */		
		public static var cacheManager:ICacheManager;
		/**
		 *	数据管理器 
		 */		
		public static var sqlManager:ISQLLiteManager;
		/*mysql管理器*/
		public static var mysql:ISQLLiteManager;
		/**
		 * 	日志管理器
		 */
		public static var logManager:ILogManager;
		
		/**
		 *	加载管理器 
		 */		
		public static var loaderManager:ILoaderManager;
		
		/**
		 *	键盘管理器 
		 */		
		public static var keyboardManager:IKeyboardApi;
		
		/**
		 *	图片处理器 
		 */		
		public static var imageManager:IImageApi;
		/**
		 *	正则匹配器 
		 */		
		public static var regexMatcher:IRegexMatcher;
		
		public function GlobalAPI() {
		} 
		
		public static function setup(listener:Stage):void { 
			GlobalAPICore.setup(listener);
			
			if(!river) river = GlobalAPICore.river;// new TickManager(listener) as ITickManager;
			
			if(!fileManager) fileManager = new FileManager as IFileManager;
			GlobalAPICore.fileManager = fileManager;
			
			if(!mouseManager) mouseManager = GlobalAPICore.mouseManager;// new MouseManager(listener) as IMouseManager;
		
			if(!timeManager) timeManager = GlobalAPICore.timeManager;// new TimeManager() as ITimeManager;
			
			if(!cacheManager) cacheManager = GlobalAPICore.cacheManager;// new CacheManager as ICacheManager;
			
			if(!sqlManager) sqlManager = new SQLLiteManager as ISQLLiteManager;
			
			if(!mysql) mysql = new SQLManager as ISQLLiteManager;
			
			if(!logManager) logManager = GlobalAPICore.logManager;// new LogManager as ILogManager;
			
			if(!loaderManager) loaderManager = GlobalAPICore.loaderManager;// new LoaderManager as ILoaderManager;
			
			if(!keyboardManager) keyboardManager = GlobalAPICore.keyboardManager;// new KeyboardManager(listener) as IKeyboardApi;
			
			if(!imageManager) imageManager = GlobalAPICore.imageManager;// new ImageApi as IImageApi;
			
			if(!regexMatcher) regexMatcher = GlobalAPICore.regexMatcher;
		}
		
		
	}
}